#ifndef _CBSOCKET_LISTENER_H
#define _CBSOCKET_LISTENER_H

#include <tr1/functional>

#include "AbstractCallback.h"

namespace cbsocket
{
    class CBSocket;
    
    class Listener : public AbstractCallback
    {
    public:
        Listener(int fd, CBSocket *sockMgr, std::tr1::function<AbstractCallback*(int)> const& callbackMaker);
        
        virtual void dataReady();
        
        virtual bool needCleanUp();
        
    private:
        Listener(Listener const&);
        Listener& operator = (Listener const&);
        
        CBSocket *sockMgr;
        std::tr1::function<AbstractCallback*(int)> const& callbackMaker;
    };
}

#endif
